package demo02;

/**
 * @author: WangPeng
 * @createTime: 2022/10/31 17:21
 * @description:
 * @version: v1.0
 */
public class Test01 {
    public static void main(String[] args) {
        //0.创建任务对象
        MyRunnable task1 = new MyRunnable();
        //1.创建线程对象
        Thread t1 = new Thread(task1,"线程A");
        //开启线程，会执行Runnable中的run方法
        t1.start();
        for (int i = 0; i < 20; i++) {
            System.out.println(Thread.currentThread().getName()+"执行"+i);
        }
    }
}
